﻿using System;

/* 输入一段字符，将大写转为小写，小写转为大写 */
namespace Practice5
{ 
    public class Practice
    {
        static string ConvertLowOrUp(string s)
        {
            string str = "";
            foreach (char i in s)
            {
                if (i >= 'A' && i <= 'Z')
                {
                    str += i.ToString().ToLower();
                }
                else if (i >= 'a' && i <= 'z')
                {
                    str += i.ToString().ToUpper();
                }
                else
                {
                    str += i;
                }
            }
            return str;
        }

        public static void Execute()
        {
            Console.Write("输入待转换字符串: ");
            string str = Console.ReadLine();
            string res = ConvertLowOrUp(str);
            Console.WriteLine("res: {0}", res);
        }
    }
}